﻿$(function () {
    //获取收件人
    $.ajax({
        url: "/ashx/xingyeGetRecipients.ashx",
        dataType: "json",
        success: function (data) {
            if (data.length<1) {
                alert("未获取到收件人，请联系管理员");
            } else {
                //var list = $.parseJSON(data);
                $.each(data, function (idx, v) {
                    $("#rr").append("<option>" + v + "</option>");
                });
            }
        }
    });

    $('#zz').click(function () {
        //取值
        var aa = $('#aa').val().trim();
        var bb = $('#bb').val().trim();
        var cc = $('#cc').val().trim();
        var dd = $('#dd').val().trim();
        var ee = $('#ee').val().trim();
        var ff = $('#ff').val().trim();
        var gg = $('#gg').val().trim();
        var hh = $('#hh').val().trim();
        var ii = $('#ii').val().trim();
        var jj = $('#jj').val().trim();
        var kk = $('#kk').val().trim();
        var ll = $('#ll').val().trim();
        var mm = $('#mm').val().trim();
        var nn = $('#nn').val().trim();
        var oo = $('#oo').val().trim();
        var pp = $('#pp').val().trim();
        var qq = $('#qq').val().trim();
        var rr = $('#rr').val().trim();
        var ss = $('#ss').val().trim();

        //有效性检查
        if (aa.length == 0 || bb.length == 0 || cc.length == 0 || dd.length == 0 || ee.length == 0 || ff.length == 0 || gg.length == 0 || hh.length == 0 || ii.length == 0 || jj.length == 0 || kk.length == 0 ||  mm.length == 0 || nn.length == 0) {//2024.4.22去掉其他约定的检查
            alert("有内容为空，请填写！")
            return;
        }

        $('#zz').prop("disabled", true);

        $.ajax({
            url: "/ashx/gdHandler.ashx",
            async: false,
            type: "post",
            data: {
                aa: aa,
                bb: bb,
                cc: cc,
                dd: dd,
                ee: ee,
                ff: ff,
                gg: gg,
                hh: hh,
                ii: ii,
                jj: jj,
                kk: kk,
                ll: ll,
                mm: mm,
                nn: nn,
                oo: oo,
                pp: pp,
                qq: qq,
                rr: rr,
                ss: ss,
            },
            success: function (msg) {
                alert(msg);
                $('#zz').prop("disabled", false);
            }
        });
    });
});